package com.smart.platform.web.flow;

import com.smart.platform.entity.outcome_node.Outcome;
import com.smart.platform.service.impl.OutcomeService;
import com.smart.platform.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * Created by 郭晓萌 on 2018/7/6 0006.
 */
@Controller
@RequestMapping("/flow")
public class FlowController {
    @Autowired
    private OutcomeService outcomeService;
    @RequestMapping("/toFlow.html")
    public String toOutcome(Map<String, Object> map, Outcome outcome, Integer page, Integer pageSize) throws Exception {
        if (outcome != null) {
            map.put("outname", outcome);
        }
        PageUtil<Outcome> outcomePageUtil = outcomeService.findAll(outcome, page, pageSize);
        map.put("datas", outcomePageUtil);
        return "flow/flow_list";
    }
}
